<template>
	<view class="choose-box">
		<view class="progress-wrap" v-for="(item, index) in multilData" :key="item.id">
			<view class="progress" v-if='item.canClick === true'>
				<view class="pro_titl">
					{{item.content}}
				</view>
			</view>
			<view class="progress" v-else>
				<view class="pro_titl" @tap="chooseVal()">
					{{item.content}} ({{item.number || 0}}%)
				</view>
				<view class="pro_index" :style="{width: item.number + '%',background:`linear-gradient(270deg, ${item.color1} 0%, ${item.color2} 100%)` }">
				</view>
			</view>
			<!-- <view class="percentage">{{item.number || 0}}% </view> -->
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			multilData: {
				type: Array,
				default: []
			},
		},
		data() {
		  return {
		  }
		},
		methods: {
			chooseVal() {
				console.info('触发了选项')
			}
		}
	}
</script>

<style lang="scss" scoped>
	.choose-box {
		
	}
	.progress-wrap {
		width: 100%;
		// padding-left: 34rpx;
		box-sizing: border-box;
		display: flex;
		align-items: center;
		margin-bottom: 20rpx;

		.pro_titl {
			font-size: 15rpx;
			line-height: 50rpx;
			position: absolute;
			z-index: 555;
			left:20rpx;
			color: #080808;
			// letter-spacing: 1rpx;
		}

		.progress {
			width: 100%;
			height: 50rpx;
			background: #F0F0F0;
			border-radius: 5rpx;
			position: relative;

			.pro_index {
				position: absolute;
				top: 0;
				left: 0;
				height: 50rpx;
				background: linear-gradient(270deg, #72EDE3 0%, #A08EFF 100%);
				border-radius: 5rpx;
			}
		}

		.percentage {
			line-height: 60rpx;
			margin-left: 24rpx;
			font-size: 24rpx;
		}
	}
</style>
